package edu.gmu.middleware;

import java.nio.ByteBuffer;

/**
 * DispatchEntry represents bundling of Sink and ByteBuffer.
 * 
 * @author  James H. Pope
 * @version $Revision:$ $Date:$
 */
public class DispatchEntry
{
    /**
     * header
     */
    private Header header = null;
    
    /**
     * inBuffer
     */
    private ByteBuffer inBuffer = null;
    
    /**
     * sink
     */
    private Sink sink = null;
    
    
    /**
     * Creates a new DispatchEntry with specified parameters.
     * @param header
     * @param inBuffer
     * @param sink
     */
    public DispatchEntry( Header header, ByteBuffer inBuffer, Sink sink )
    {
        this.header    = header;
        this.inBuffer  = inBuffer;
        this.sink      = sink;
    }
    
    /**
     * Gets the header
     * @return header
     */
    public Header getHeader( )
    {
        return this.header;
    }
    
    /**
     * Gets the inBuffer
     * @return inBuffer
     */
    public ByteBuffer getInBuffer( )
    {
        return this.inBuffer;
    }
    
    /**
     * Gets the sink
     * @return sink
     */
    public Sink getSink( )
    {
        return this.sink;
    }
    
    public String toString()
    {
        StringBuffer buf = new StringBuffer();
        buf.append( " header"+header );
        buf.append( " sink="+sink );
        return buf.toString();
    }
}
